package website.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import website.advice.BaseResponse;
import website.domain.Link;
import website.domain.ResModel;
import website.domain.WebInfo;
import website.service.LinkService;
import website.service.WebService;

import java.util.List;

@Api("网站控制类")
@BaseResponse
@RestController
@RequestMapping("/api/web")
public class WebController {

    @Autowired
    private WebService webService;

    @ApiOperation("查询网站信息")
    @GetMapping
    public ResModel<WebInfo> list(){
        return webService.getWebInfo();
    }

    @ApiOperation("发布网站公告")
    @PutMapping(path = "",produces = "application/json")
    public ResModel issue(@RequestBody WebInfo webInfo){
        return webService.issue(webInfo);
    }
}
